﻿<phone:PhoneApplicationPage 
    x:Class="DnnDash.SimplePhoneApp.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:views="clr-namespace:DnnDash.SimplePhoneApp.View"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">
    <shell:SystemTray.ProgressIndicator>
        <shell:ProgressIndicator IsIndeterminate="true" IsVisible="{Binding Main.IsLoading}" />
    </shell:SystemTray.ProgressIndicator>
    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <toolkit:GestureService.GestureListener>
            <toolkit:GestureListener Hold="TapAndHold" />
        </toolkit:GestureService.GestureListener>
        <!--Pivot Control-->
        <controls:Pivot Title="{Binding InstanceName}" x:Name="uiDashPivot" ItemsSource="{Binding}" >
            <controls:Pivot.ItemTemplate>
                <DataTemplate>
                    <StackPanel>
                        <Button Name="Set List as Favorite" Click="Favorite_Click">
                            <Grid>
                                <TextBlock Text="Favorite" FontSize="{StaticResource PhoneFontSizeSmall}" Foreground="{StaticResource PhoneAccentBrush}" />
                            </Grid>
                        </Button>
                        <ScrollViewer Margin="0,0,12,0" Width="Auto" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Visible" VerticalContentAlignment="Top">
                        <ListBox Name="ExpViewList" Margin="8,0" ItemsSource="{Binding}" ScrollViewer.VerticalScrollBarVisibility="Auto" Height="600" Width="485"  VerticalAlignment="Top">
                            <ListBox.ItemContainerStyle >
                                <Style TargetType="ListBoxItem">
                                    <Setter Property="HorizontalContentAlignment" Value="Left" />
                                </Style>
                            </ListBox.ItemContainerStyle>
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                        <StackPanel Width="480">
                                        <toolkit:ExpanderView Margin="0,0,0,8" x:Name="expander" Header="{Binding SettingsParentName}" Expander="{Binding}" 
                                                              IsExpanded="{Binding IsExpanded}" HorizontalAlignment="Left"  HorizontalContentAlignment="Left" Width="480">
                                            <toolkit:ExpanderView.HeaderTemplate>
                                                <DataTemplate>
                                                    <TextBlock Text="{Binding SettingsParentName}" FontSize="{StaticResource PhoneFontSizeLarge}" Foreground="{StaticResource PhoneAccentBrush}" />
                                                </DataTemplate>
                                            </toolkit:ExpanderView.HeaderTemplate>
                                            <views:DashSettingsView >
                                            </views:DashSettingsView>
                                        </toolkit:ExpanderView>
                                    </StackPanel>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>
                    </ScrollViewer>
                    </StackPanel>
                </DataTemplate>
            </controls:Pivot.ItemTemplate>
        </controls:Pivot>
    </Grid>
 
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/images/appbar.feature.settings.rest.png" Text="Refresh" Click="OnAppBarSettingsClick" />
            <shell:ApplicationBarIconButton IconUri="/images/appbar.refresh.rest.png" Text="Refresh" Click="OnAppBarRefreshClick" />
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="About" Click="OnAppBarAboutClick" />
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>